﻿using System;
using System.Text.RegularExpressions;
using System.Threading;

namespace AMEE.MyFusionTest
{
    class Program
    {
        static ManualResetEvent escapeEvent = new ManualResetEvent(false);

        static void Main(string[] args)
        {
            Thread cReader = new Thread(ConsoleThread);
            cReader.Start();

            Kinect myKinect = new Kinect(true, false);
            myKinect.FPSEvent += myKinect_FPSEvent;
            myKinect.StartFpsTimer();
            myKinect.init();

            Program.escapeEvent.WaitOne();
            myKinect.Dispose();

        }

        static void myKinect_FPSEvent(object sender, FPSEventArg e)
        {
            Console.WriteLine("FPS: " + e.Fps);
        }

        //static void playSounds(Kinect myKinect)
        //{
        //    myKinect.EntrySound.Play();
        //    Thread.Sleep(1000);
        //    myKinect.FinishedSound.Play();
        //    Thread.Sleep(500);
        //}

        static void ConsoleThread()
        {
            ConsoleKeyInfo key;
            do
            {
                key = Console.ReadKey();
            } while (key.Key != ConsoleKey.Escape);
            Program.escapeEvent.Set();
        }

    }
}
